home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 14 / Hot Mix 14.iso / HTML / vendors / finesse / examples / examples_csh next >
Text File  |  1996-06-27  |  3KB  |  104 lines

  1. #! /bin/csh
  2. # FINESSEAPPLICATIONKEY spjdnVdx_darf
  3.  
  4. # csh script initialization
  5. if (! $?FINESSEPATH) \
  6.   set FINESSEPATH = /usr/local/finesse
  7. source $FINESSEPATH/fscshinit
  8.  
  9. set examplespath = $FINESSEPATH/examples
  10. set examplespath = /proj/finesse/examples
  11. set appdefpath = $examplespath/app-defaults
  12. set bitmapspath = $appdefpath/bitmaps
  13. set cshdir = $examplespath/csh
  14.  
  15. # define bitmap/pixmap files
  16.  
  17. set logo = $bitmapspath/logo
  18. set logoxbm = $bitmapspath/logo.xbm
  19. set logoxpm = $bitmapspath/logo.xpm
  20. set hw = $bitmapspath/hello_world
  21. set hwxbm = $bitmapspath/hello_world.xbm
  22. set hwxpm = $bitmapspath/hello_world.xpm
  23.  
  24. # make sure XAPPLRESDIR is used to get bitmaps
  25.  
  26. unsetenv XUSERFILESEARCHPATH
  27. setenv XAPPLRESDIR $appdefpath
  28.  
  29. # define examples and main window
  30.  
  31. set nrows = 2; set ftag = f
  32.  
  33. set j = 0; set k = 0
  34. set examples = "FsForm -name mf;"
  35.  
  36. foreach i (`(cd $cshdir; ls)`)
  37.   set k = `expr $j / $nrows`
  38.   expr $j % $nrows > /dev/null
  39.   if ( $status == 0 ) then
  40.     set form1 =
  41.     set form2 =
  42.   else
  43.     set form1 = "FsForm -name $ftag$k"
  44.     set form2 = "-orientation horizontal -parent mf;"
  45.   endif
  46.   set form = "$form1 $form2"
  47.   set push1 = "FsPushButton -label $i -parent $ftag$k"
  48.   set push2 = "-name $i -winstat touch;"
  49.   set push = "$push1 $push2"
  50.   set examples = "$examples $form $push"
  51.   set j = `expr $j + 1`
  52. end
  53.  
  54. set lb = "FsPushButton -name s+c -winstat touch"
  55. set lbargs = "-fsbutton s+c -parent $ftag$k;"
  56. set okb = "FsPushButton -label OK;"
  57. set mainwin = \
  58.   "FsWindow -name main; $examples $lb $lbargs $okb"
  59.  
  60.  
  61. # use either bitmap or pixmap files
  62.  
  63. /bin/rm -f $logo $hw
  64.  
  65. if (( "`uname`" == "OSF1" ) || \
  66.     ( "`uname`" == "AIX" && "`uname -v`" == "4" ) || \
  67.     ( "`uname`" == "SunOS" && \
  68.       "`uname -r | cut -d. -f1`" == "5" )) then
  69.   ln -s $logoxpm $logo; ln -s $hwxpm $hw
  70. else 
  71.   ln -s $logoxbm $logo; ln -s $hwxbm $hw
  72. endif
  73.  
  74. # Finesse dialog
  75.  
  76. Fsopen
  77. Fsdisplay -w "$mainwin"
  78. while (1)
  79.   switch ($fsbutton)
  80.     case OK:
  81.     case a: 
  82.       break
  83.     case s+c:
  84.       Fsecho "Finesse by:"
  85.       Fsecho "science+computing gmbh"
  86.       Fsecho "Hagellocher Weg 71"
  87.       Fsecho "D-72070 Tuebingen"
  88.       Fsecho "Germany"
  89.       Fsecho "Phone: (49) 7071/9457-0"
  90.       Fsecho "Fax:   (49) 7071/9457-27\c"
  91.       set updt = "-r s+c:background:IndianRed3"
  92.       breaksw
  93.     default: 
  94.       ( unsetenv FSREADFILE FSWRITEFILE; \
  95.         $cshdir/$fsbutton )
  96.       set updt = "-r ${fsbutton}:background:IndianRed3"
  97.       breaksw
  98.   endsw
  99.   Fsdisplay -n main $updt
  100. end
  101. Fssave
  102. /bin/rm -f $logo $hw
  103. Fsclose
  104.